package juc.thread;

/**
 * 枚举类
 */
public enum CountryEnum {
    ONE(1,"齐国"),
    TWO(2,"楚国"),
    THREE(3,"燕国"),
    FOUR(4,"韩国"),
    FIVE(5,"赵国"),
    SIX(6,"魏国");

    public int number;
    public String countryName;

    CountryEnum(int number, String countryName) {
        this.number = number;
        this.countryName = countryName;
    }

    public static CountryEnum forEach_CountryEnum(int index){
         CountryEnum[] countryEnums = CountryEnum.values();
        for (CountryEnum countryEnum : countryEnums) {
            if (countryEnum.number==index){
                return countryEnum;
            }
        }
        return null;
    }

}
